home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from yahoo.yahoolookup import services
- from yahoo.yahoolookup import statuses
- from yahoo.yahooutil import to_ydict
- from yahoo.yahooP2Psocket import YahooP2PSocket
-
- class YahooP2P(object):
-
- def __init__(self, yahoo, buddy, me, remote_client, session_id):
- self.yahoo = yahoo
- self.buddy = buddy
- self.me = me
- self.rc = remote_client
- self.socket = YahooP2PSocket(self, self.rc, session_id)
- self.socket.connect(self.rc)
-
-
- def incoming_message_raw(self, ydict_iter):
- self.yahoo.incoming_message_raw(ydict_iter)
-
- message_notinoffice_raw = message_offline_raw = message_brb_raw = incoming_message_raw
-
- def notify_typing(self, typing_status, flag):
- self.yahoo.notify_brb(self.buddy, typing_status, flag)
-
-
- def on_close(self):
- foo = self.yahoo.peertopeers.pop(self.buddy)
-
-
- def on_connect(self):
- self.send('p2pfilexfer', 'available', buddy = self.me, to = self.buddy, flag = '1', typing_status = 'PEERTOPEER', **{
- '2': '1' })
-
-
- def p2pfilexfer_available(self, buddy, to, flag, typing_status, **k):
- if flag == '5':
- self.send('p2pfilexfer', 'available', buddy = to, to = buddy, flag = '6', typing_status = 'PEERTOPEER')
- elif flag == '7':
- self.send('p2pfilexfer', 'available', buddy = to, to = buddy, flag = '7', typing_status = 'PEERTOPEER')
-
-
-
- def send(self, service, status, ydict = { }, **kw):
- self.socket.ysend(services[service], statuses[status], data = to_ydict(ydict))
-
-
- def Disconnect(self):
- self.socket.close()
- foo = self.yahoo.peertopeers.pop(self.buddy)
-
-
-